package com.xuecheng.media.api;

import com.xuecheng.commons.model.vo.MediaVo;
import com.xuecheng.commons.model.vo.ResourceVo;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

@FeignClient("xc-media-service")
public interface MediaClient {

    /**
     * feign远程调用查询媒资
     *
     * @param mediaId 媒资id
     * @return 结果
     */
    @GetMapping("/media/{mediaId}")
    ResponseResult<MediaVo> findMediaById(@PathVariable Long mediaId);

    /**
     * 获取播放url
     *
     * @param mediaId id
     * @return url
     */
    @GetMapping("/media/media-url/{mediaId}")
    public ResponseResult<ResourceVo> gainMediaUrl(@PathVariable Long mediaId);
}
